const { defineConfig } = require('@vue/cli-service')
const WindiCSSWebpackPlugin = require('windicss-webpack-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const path = require('path');

module.exports = defineConfig({
	transpileDependencies: true,
	productionSourceMap: false,
	lintOnSave: false,
	publicPath: './',
	configureWebpack: {
		externals: {
			'@lexmis/magic-ui/pc': '@lexmis/magic-ui/pc'
		},
		resolve: {
			alias: {
				'vue$': 'vue/dist/vue.esm.js',
			}
		},
		plugins: [
			new WindiCSSWebpackPlugin(),
			new BundleAnalyzerPlugin({
				analyzerMode: 'static',
				openAnalyzer: false,
				reportFilename: path.join(__dirname, 'lib', 'bundle-report.html'),
			}),
		]
	}
})